home *** CD-ROM | disk | FTP | other *** search
- 1 'Written by Jeffrey D. Prouty, Jordan Oil & Gas Co., January 1986
- 3 ON ERROR GOTO 900
- 5 COLOR 9,0,0 : CLS
- 10 PRINT "**** CONTEXT ****" : PRINT : PRINT
- 20 PRINT "This program accepts an AutoCAD DXF file as input,
- 30 PRINT "extracts the X,Y endpoints of all lines on numbered
- 40 PRINT "layers, and writes them to an X,Y,Z DAT file of the
- 50 PRINT "same name with the layer names as Z values. Thus,
- 60 PRINT "contours may be Sketched on separate layers and ex-
- 70 PRINT "tracted for input to a contouring program (3F14.x).
- 90 PRINT : PRINT
- 100 INPUT "Name of DXF file (extention of .DXF assummed)";F$
- 120 OPEN F$+".DXF" FOR INPUT AS #1
- 130 OPEN F$+".DAT" FOR OUTPUT AS #2
- 200 WHILE L$<>"ENTITIES" : LINE INPUT #1, L$ : WEND
- 300 WHILE L$<>"LINE" : LINE INPUT #1, L$ : WEND
- 400 INPUT #1, L$, Z1 : IF Z1=0 THEN 300
- 410 INPUT #1, L$, X1
- 420 INPUT #1, L$, Y1
- 425 IF X2<>0 THEN IF X1<>X2 AND Y1<>Y2 THEN PRINT #2, X2, Y2, Z2
- 427 PRINT #2, X1, Y1, Z1 : Z2=Z1
- 430 INPUT #1, L$, X2
- 440 INPUT #1, L$, Y2
- 590 GOTO 300
- 900 PRINT #2, X2, Y2, Z2
- 910 PRINT : PRINT "Contour data has been extracted to file: ";F$;".DAT"
- 920 CLOSE 1, 2
- 998 SYSTEM
- 999 END